@extends('admin.layout.index')


@section('content')

<div class="mws-panel grid_8">
                        <div class="mws-panel-header">
                            <span>
                                <i class="icon-table">
                                    
                                </i> 
                                订单列表
                            </span>
                        </div>
                        <div class="mws-panel-body no-padding">
                        <div id="DataTables_Table_1_wrapper" class="dataTables_wrapper" role="grid">
                        <div id="DataTables_Table_1_length" class="dataTables_length">
                        <form action="/admin/order/index" method="get">
                            
                        </div>
                            <div class="dataTables_filter" id="DataTables_Table_1_filter">
                                    <label>关键字: <input type="text" name="search" value="{{ $request['search'] or ''}}"  aria-controls="DataTables_Table_1" >
                                    </label>
                                    <input type="submit" value="搜索">
                            </form>
                            </div>
                            <table class="mws-datatable-fn mws-table dataTable" id="DataTables_Table_1" aria-describedby="DataTables_Table_1_info">
                                <thead>
                                        <tr role="row">
                                        <th class="sorting_asc"  style="width: 194px;">订单编号</th>
                                        <th class="sorting_asc"  style="width: 194px;">用户编号</th>
                                        <th class="sorting_asc"  style="width: 194px;">用户名</th>
                                        <th class="sorting_asc"  style="width: 194px;">下单时间</th>
                                        <th class="sorting_asc"  style="width: 194px;">订单号</th>
                                        <th class="sorting_asc"  style="width: 194px;">付款状态</th>
                                        <th class="sorting_asc"  style="width: 194px;">货物状态</th>
                                        <th class="sorting_asc"  style="width: 194px;">操作</th>   
                                </thead>
                            
                                <tbody role="alert" aria-live="polite" aria-relevant="all">

                                <!-- 循环遍历，取出相应的数据 -->
                                @foreach($data as $k => $v)
                                    <tr class="odd">
                                        <td class=" ">{{$v['id']}}</td>
                                        <td class=" ">{{$v['uid']}}</td>
                                        <td class=" ">{{$v['uname']}}</td>
                                        <td class=" ">{{$v['atime']}}</td>
                                        <td class=" ">{{$v['ddid']}}</td>
                                        <!-- 判断付款状态 -->
                                        @if($v['state'] == 0)
                                        <td class=" ">待付款</td>
                                        @elseif($v['state'] == 1)
                                        <td class=" ">已付款</td>
                                        @endif
                                        <!-- 判断货物状态 -->
                                        @if($v['payway'] == 0)
                                        <td class=" ">未发货</td>
                                        @elseif($v['payway'] == 1 )
                                        <td class=" ">已发货</td>
                                        @else($v['payway'] == 2)
                                        <td class=" ">已收货</td>
                                        @endif
                                        <td class=" ">
                                            <a href="/admin/order/delete/{{$v['id']}}" style="color:black;font-size:10px;margin-left:1px" title="删除">删除</a>
                                            <a href="/admin/order/edit/{{$v['id']}}" style="color:black;font-size:10px;margin-left:1px" title="修改">修改</a>
                                             <a href="/admin/order/list/{{$v['id']}}" style="color:black;font-size:10px;margin-left:1px" title="订单详情">订单详情</a>
                                        </td>
                                    </tr>
                               @endforeach
                                </tbody>
                            </table>
                                    <div class="dataTables_info" id="DataTables_Table_1_info">
                                        Showing 1 to 10 of 57 entries
                                    </div>
                                  
                                </div>
                    </div>
                </div>
@endsection